/*
 * @Author: niuzhiyong niuzhiyong@erayt.com
 * @Date: 2025-01-18 15:55:39
 * @LastEditors: niuzhiyong niuzhiyong@erayt.com
 * @LastEditTime: 2025-01-18 15:59:21
 * @FilePath: \study\react-ts\src\Router.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React from "react";
import { BrowserRouter as Router, Routes, Route, Link } from "react-router-dom";
import Home from "./pages/Home/Home"; // 假设你有一个 Home 组件
import About from "./pages/About/About"; // 假设你有一个 About 组件
import NotFound from "./pages/NotFound/NotFound"; // 假设你有一个 NotFound 组件

const RouterComponent: React.FC = () => {
  return (
    <Router>
      <nav>
        <ul>
          <li>
            <Link to="/">Home</Link>
          </li>
          <li>
            <Link to="/about">About</Link>
          </li>
        </ul>
      </nav>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/about" element={<About />} />
        <Route path="*" element={<NotFound />} /> {/* 404 页面 */}
      </Routes>
    </Router>
  );
};

export default RouterComponent;
